home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Development Kits / MPW etc. / MPW-GM / Interfaces&Libraries / Interfaces / PInterfaces / ENET.p < prev    next >
Encoding:
Text File  |  1998-02-17  |  3.6 KB  |  128 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ENET.p
  3.  
  4.      Contains:    Ethernet Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ENET;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __ENET__}
  28. {$SETC __ENET__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ENETIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __OSUTILS__}
  38. {$I OSUtils.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. CONST
  48.     ENetSetGeneral                = 253;                            { Set "general" mode }
  49.     ENetGetInfo                    = 252;                            { Get info }
  50.     ENetRdCancel                = 251;                            { Cancel read }
  51.     ENetRead                    = 250;                            { Read }
  52.     ENetWrite                    = 249;                            { Write }
  53.     ENetDetachPH                = 248;                            { Detach protocol handler }
  54.     ENetAttachPH                = 247;                            { Attach protocol handler }
  55.     ENetAddMulti                = 246;                            { Add a multicast address }
  56.     ENetDelMulti                = 245;                            { Delete a multicast address }
  57.  
  58.     EAddrRType                    = 'eadr';                        { Alternate address resource type }
  59.  
  60.  
  61. TYPE
  62.     EParamBlockPtr = ^EParamBlock;
  63.     EParamBlkPtr                        = ^EParamBlock;
  64. {$IFC TYPED_FUNCTION_POINTERS}
  65.     ENETCompletionProcPtr = PROCEDURE(thePBPtr: EParamBlkPtr);
  66. {$ELSEC}
  67.     ENETCompletionProcPtr = Register68kProcPtr;
  68. {$ENDC}
  69.  
  70.     ENETCompletionUPP = UniversalProcPtr;
  71.     EParamBlock = PACKED RECORD
  72.         qLink:                    QElemPtr;                                { General EParams }
  73.         qType:                    INTEGER;                                { queue type }
  74.         ioTrap:                    INTEGER;                                { routine trap }
  75.         ioCmdAddr:                Ptr;                                    { routine address }
  76.         ioCompletion:            ENETCompletionUPP;                        { completion routine }
  77.         ioResult:                OSErr;                                    { result code }
  78.         ioNamePtr:                StringPtr;                                { ->filename }
  79.         ioVRefNum:                INTEGER;                                { volume reference or drive number }
  80.         ioRefNum:                INTEGER;                                { driver reference number }
  81.         csCode:                    INTEGER;                                { Call command code }
  82.         CASE INTEGER OF
  83.         0: (
  84.             eProtType:            INTEGER;                                { Ethernet protocol type }
  85.             ePointer:            Ptr;                                    { No support for PowerPC code }
  86.             eBuffSize:            INTEGER;                                { buffer size }
  87.             eDataSize:            INTEGER;                                { number of bytes read }
  88.            );
  89.         1: (
  90.             eMultiAddr:            PACKED ARRAY [0..5] OF Byte;            { Multicast Address }
  91.            );
  92.     END;
  93.  
  94.  
  95. CONST
  96.     uppENETCompletionProcInfo = $00009802;
  97.  
  98. PROCEDURE CallENETCompletionProc(thePBPtr: EParamBlkPtr; userRoutine: ENETCompletionUPP);
  99.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  100.     {To be implemented:  Glue to move parameters into registers.}
  101.     {$ENDC}
  102.  
  103. FUNCTION NewENETCompletionProc(userRoutine: ENETCompletionProcPtr): ENETCompletionUPP;
  104.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  105.     INLINE $2E9F;
  106.     {$ENDC}
  107. FUNCTION EWrite(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  108. FUNCTION EAttachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  109. FUNCTION EDetachPH(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  110. FUNCTION ERead(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  111. FUNCTION ERdCancel(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  112. FUNCTION EGetInfo(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  113. FUNCTION ESetGeneral(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  114. FUNCTION EAddMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  115. FUNCTION EDelMulti(thePBptr: EParamBlkPtr; async: BOOLEAN): OSErr;
  116.  
  117.  
  118. {$ALIGN RESET}
  119. {$POP}
  120.  
  121. {$SETC UsingIncludes := ENETIncludes}
  122.  
  123. {$ENDC} {__ENET__}
  124.  
  125. {$IFC NOT UsingIncludes}
  126.  END.
  127. {$ENDC}
  128.